package com.usian.user.feign;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usian.model.article.pojos.ApArticle;
import com.usian.model.article.pojos.ApAuthor;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.common.enums.AppHttpCodeEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@FeignClient("leadnews-article")
public interface ArticleFeign {

    @RequestMapping("/api/v1/author/findByUserId/{id}")
    public ApAuthor findByUserId(@PathVariable("id") Integer id);


    @RequestMapping("/api/v1/author/save")
    public ResponseResult save(@RequestBody ApAuthor apAuthor);

    /**
     * 根据id查找对应的用户对象
     * @param id
     * @return
     */
    @GetMapping("/api/v1/author/one/{id}")
    public ApAuthor findById(@PathVariable("id") Integer id);

    @GetMapping("/api/v1/article/findById/{id}")
    public ApArticle findByArticleId(@PathVariable Integer id);
}
